package com.example.administrator.babymusic.ui.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.administrator.babymusic.R;
import com.example.administrator.babymusic.widget.ListMoreFgItem;

import java.util.List;

/**
 * Created by Administrator on 2016/11/3 0003.
 */

public class GridAdapter extends AdapterBase {


    public GridAdapter(Context context, int[] layoutResArrays, List data) {
        super(context, layoutResArrays, data);
    }

    @Override
    protected void convert(ViewHolderHelper helper, Object item) {
        View view = helper.getView();
        ImageView fgMoreImage = (ImageView) view.findViewById(R.id.fg_more_image);
        TextView fgTextView = (TextView) view.findViewById(R.id.fg_more_title);
        ListMoreFgItem lmfItem = (ListMoreFgItem) item;
        fgMoreImage.setImageResource(lmfItem.getImageId());
        fgTextView.setText(lmfItem.getText());
    }
}
